		<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Xpress网上办公系统</title>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<LINK href="./css/oa.css" type=text/css rel=stylesheet>
<LINK href="./css/mail.css" type=text/css rel=stylesheet>
<LINK id=theme href="" type=text/css rel=stylesheet>

<script type="text/javascript" src="resources/js/ext-base.js"></script>
<script type="text/javascript" src="resources/js/ext-all.js"></script>
<script type="text/javascript" src="resources/js/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="./css/ext-extends.js"></script>
</head>

<script>
gridUtils = new Ext.util.GridUtils();
treeUtils = new Ext.util.TreeUtils();
formUtils = new Ext.util.FormUtils();

Ext.QuickTips.init(); 
Ext.form.Field.prototype.msgTarget = 'side';  
	
function openBoard(rootid)
{
	var gridstore = Ext.getCmp("info1").store;
				            	
    gridstore.load({params:{start:0, rootid:rootid}, callback:function(r, options, success)
      {     
      		if(success)
      		{
	      		Ext.getCmp("currentpath").value = Ext.getCmp("currentpath").value + ";" + rootid;
	      		
	      		Ext.getCmp("parentid").value = rootid;
	      		
	      		ids = Ext.getCmp("currentpath").value.split(";"); 
	      		
	      		if(rootid == "-1")
	      			Ext.getCmp("backparentboard").setDisabled(true);
	      		else
	      			Ext.getCmp("backparentboard").setDisabled(false);
	      			
	      		Ext.getCmp("backid").value = ids[ids.length-2];
	      		
	      		delete ids;
	      	}
      }
    });
       
   delete gridstore;   
}

Ext.onReady(function(){
    var win;
    
    Ext.QuickTips.init(); 
    Ext.form.Field.prototype.msgTarget = 'side';   

        if(!win){
        	// Toolbar
        	northToolbar = new Ext.Toolbar({
        		id:"toolbarNorthToolbar",
				items:[
				{
					id:"tbbuttonLogout",
					text:"退出系统",
					icon:"./images/oa/logout16x16.png",
					cls:"x-btn-text-icon",
					tooltip:"<b>退出系统</b><br/>退出Synchrophy系统",
					enableToggle:false,
					pressed:false,
					
					handler:function(){
						Ext.MessageBox.confirm("Info", "Are you want to logout?", 
							function(btn, text)
							{
								if (btn == 'yes')
								{
									A = Ext.MessageBox.wait("Please Wait...","Logging Out...",{
										text:"Logging Out..."
									});
							
									Ext.Ajax.request({
										url:"../ajxrpc/logout.logout",
										method:"GET",
										success:function(B,C){
											var D=Ext.util.JSON.decode(B.responseText);
											if(D.success){
												A.hide();
												window.location.href = './index.html';
											}
										},
										failure:function(B,C){
											A.hide();
											Ext.Msg.alert("Error","Unable to Logout!")
										},
										scope:this
									})
								}
							}
						,this);
					},
					scope:this
				},
				{
					id:"tbbuttonPreferences",
					text:"个人设置",
					icon:"./images/oa/preferences16x16.png",
					cls:"x-btn-text-icon",
					tooltip:"<b>个人设置</b><br/>修改用户的个人设置",
					enableToggle:false,
					pressed:false
				}
				]
			});
			
			// Center panel
			centerTabPanel = new Ext.TabPanel({
				id:"centerTabPanel",
				autoShow:true,
				deferredRender:false,
				enableTabScroll:true,
				monitorResize:true,
				border:true,
				activeTab:0,
				hideMode:"offsets",
				items:[
					new Ext.Panel({
						baseCls:"x-plain",
						title:'企业桌面',
						deferredRender:false,
						autoShow:true,
						closable:true,
						border:false
					}),
					new Ext.Panel({
						baseCls:"x-plain",
						title:'我的桌面',
						deferredRender:false,
						autoShow:true,
						border:false
					})
				]
			});
			
			centerContactsPanel = new Ext.Panel({
				baseCls:"x-plain",
				deferredRender:false,
				autoShow:true,
				activeItem:0,
				border:false
			});
			
			centerPanel = new Ext.Panel({
				id:"panelCenterPanel",
				baseCls:"x-plain",
				deferredRender:false,
				region:"center",
				autoShow:true,
				activeItem:0,
				border:false,
				layout:"card",
				hideMode:"offsets",
				items:[
					centerTabPanel
					,centerContactsPanel
				]
			});
			
			var root = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			
			v1 = root.appendChild(new Ext.tree.TreeNode({
				id:"c1",
				icon:"../ebxboard/images/board_manager.gif",				
				text:"信息发布管理"
			}));
			
			root.appendChild(new Ext.tree.TreeNode({
				id:"c2",
				icon:"../ebxboard/images/bb_search.gif",
				text:"信息搜索"
			}));
			
			var treepanel = new Ext.tree.TreePanel({
							useArrows:true,
					        animate:true,
					        enableDD:false,
							autoScroll:false,
					        rootVisible:false,
							containerScroll:false,
							root:root,
        					autoScroll:true
					});
			
			v1.on("click", function()
				{
					obj = Ext.getCmp("centerTabPanel");	
					obj1 = Ext.getCmp("info1");	
					if (obj1) {
						obj.activate(obj1);
						delete obj1;
						delete obj;
						return;
					}
					
					delete obj1;
				
				    var store = new Ext.data.Store({
			    	/**
			    	proxy: new Ext.data.MemoryProxy(myData),
			    	**/
			    	
			    	/**
			    	proxy: new Ext.data.ScriptTagProxy({
			            url: './pageinfo.jsp'
			        }),
			        **/
			        
			        proxy: new Ext.data.HttpProxy({
			            url: '../ajxrpc/ebxboard.getforums'
			        }),
			        
			        reader: new Ext.data.JsonReader({
			            root: 'rtndata.data',
			            totalProperty: 'rtndata.totalCount',
			            id:"oid",
			            fields: [
			            {name: 'seq'},
			            {name: 'oid', mapping:'id'},
			            {name: 'title'},		
						{name: 'description'},		
						{name: 'createdate'},		
						{name: 'pctChange', type: 'float'},		
						{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'},
						{name: 'excerpt'}
			            ]
			        })
			    });
				    sm = new Ext.grid.CheckboxSelectionModel({singleSelect:false});

					temp1 = obj.add(
						{
						  title:'信息发布管理',
						  id:"info1",
						  store: store,
						  closable:true,
						  sm: sm,
						  xtype:"grid",
						  columns: [
						  		new Ext.grid.SeqNumberer({seqcolumn:"seq"}),
						  	    sm,
						            {header: "信息版标题", width: 160, sortable: true, dataIndex: 'title', renderer: function(value, metadata, record, rowIndex, colIndex, store){
						            
						            	return "<a href='#' onclick='javascript:openBoard("+record.get("oid")+")'>"+value+"</a>";
						            }},
						            {header: "信息版描述", width: 75, sortable: true, dataIndex: 'description'},
						            {header: "创建时间", width: 75, sortable: true, dataIndex: 'createdate'}
						        ],
						  stripeRows: true,
						  height:350,
						  width:600,
						  viewConfig: {
					            forceFit:true,
					            enableRowBody:true,
					            showPreview:false
					        },
						  /*bbar: new Ext.PagingToolbar({
					            pageSize: 15,
					            store: store,
					            displayInfo: true
					        }),*/
					       tbar:[
						   		{
		                            id:"backid",
		                            xtype:"hidden",
									name:"backid",
									value:"-1"
	                            },
	                            {
		                            id:"parentid",
		                            xtype:"hidden",
									name:"backid",
									value:"-1"
	                            },
	                            {
		                            id:"currentpath",
		                            xtype:"hidden",
									name:"currentpath",
									value:"-1"
	                            },
						   		{
		                            text:'返回上级目录',
		                            tooltip:'返回上级目录',
		                            disabled:true,
		                            id:"backparentboard",
		                            //iconCls:'add',
									//cls:"x-btn-text-icon",
		                            handler:function(){
										var gridstore = Ext.getCmp("info1").store;
				            			
									    gridstore.load({params:{start:0, limit:15, rootid:Ext.getCmp("backid").value}, callback:function(r, options, success)
									      {    
										      if(success)
	      									  {
									      		ids = Ext.getCmp("currentpath").value.split(";");
									      		
									      		Ext.getCmp("parentid").value = Ext.getCmp("backid").value;
									      		
									      		if(Ext.getCmp("backid").value == "-1")
									      			Ext.getCmp("backparentboard").setDisabled(true);
									      		else
									      			Ext.getCmp("backparentboard").setDisabled(false); 
									      		
									      		if(Ext.getCmp("currentpath").value != "-1")
									      		{
									      			Ext.getCmp("currentpath").value = Ext.getCmp("currentpath").value.substring(0, Ext.getCmp("currentpath").value.lastIndexOf(";"));
									      			
									      			Ext.getCmp("backid").value = ids[ids.length-2];
									      		}
									      		
									      		delete ids;									      		
								      		  }
									      }
									    });
									       
									   delete gridstore;   
		                            }
		                        }, '-',
						   		{
		                            text:'增加版',
		                            tooltip:'增加版',
		                            //iconCls:'add',
									//cls:"x-btn-text-icon",
		                            handler:function(){
										win = new Ext.Window({							               
							                id:'addebxboardwin',
							                layout:'fit',
							                width:400,
							                resizable : false,
							                height:200,
							                plain: true,
							                closable:false,
							                modal:true,
											monitorValid:true,
											
											items: new Ext.FormPanel({
						                			labelWidth: 125,
						      						frame: true,
						      						id: 'ebxboardform',
						      						formId:"ebxboardform2",
						      						 //autoHeight :true;
												      title: '增加信息版',
												      bodyStyle:'padding:5px 5px 0',
												      width: 350,
												      defaults: {
												        width: 175
												      },
												      defaultType: 'textfield',
												      items: [
												      {
												        fieldLabel: '信息版标题',
												        name: 'exboardname',
												        id: 'exboardname',
												        blankText:'请输入信息版标题!',
												        allowBlank:false,
												        validateOnBlur:true,
												        xtype: 'textfield'
												      },{
												        fieldLabel: '信息版描述',
												        name: 'exboardndesc',
												        id:'exboardndesc',
												        allowBlank:false,
												        blankText:'请输入信息版描述!',
												        validateOnBlur:true,
												        xtype:'textfield'
												      }],
													  buttons: [{
													  	text:'确定',
									                    disabled:false,
														scope:this,
									                    tooltip : '确定',
														handler: function(e){
															if(Ext.getCmp("ebxboardform").form.isValid())
															{
																Ext.Ajax.request({
									                    	 		url:'../ajxrpc/ebxboard.createforum?parentid='+Ext.getCmp("parentid").value,
									                    	 		form: "ebxboardform2",
																	waitMsg:'保存信息版块中......',
									                    	 		success: function(response, options){
									                    	 			var rtndata = Ext.util.JSON.decode(response.responseText);
																		
																		if (rtndata && rtndata.success) {																														
																			gridUtils.refresh("info1");	
																			treeUtils.reloadnode("forumtreepanel", Ext.getCmp("parentid").value);																		
																																						
																			win.close();
																			Ext.destroy(win);
																		}
																		else{
																			Ext.MessageBox.show({
																				title: '保存信息版块失败',
																				msg: rtndata.message,
																				buttons: Ext.MessageBox.OK,
																				animEl: null,
																				icon: Ext.MessageBox.ERROR
																			})
																		}
									                    	 		},
									                    	 		failure: function(){
									                    	 				alert('failure');
									                    	 			}
																});
															}
													  	}
													  },
													  {
													  	text:'重置',
									                    disabled:false,
														scope:this,
									                    tooltip : '重置',
														handler: function(e){
															Ext.getCmp("ebxboardform").form.reset();
													  	}
													  },
													  {
													  	text: '关闭',
													  	disabled: false,
													  	scope: this,
													  	tooltip: '关闭',
													  	handler: function(e){
															win.close();
													  	}
													  }]
						                	})
											
											
										});
										
										win.show(this);
		                            }
		                        }, '-', {
		                            text:'设定权限',
		                            tooltip:'设定权限',
		                            //iconCls:'option',
		                            handler:function(){
										var records = Ext.getCmp("info1").getSelections();//获取所有被选中的记录集 类型：Ａｒｒａｙ	
										var _length=records.length;
													
										if(_length != 1)
										{
											Ext.Msg.alert('提示', '请选择你单个操作的记录.');											
											return false;
										}
										
										var store = new Ext.data.Store({								        
								        proxy: new Ext.data.HttpProxy({
								            url: '../ajxrpc/ebxboard.getforumacls'
								        }),
								        
								        reader: new Ext.data.JsonReader({
								            root: 'rtndata.data',
								            totalProperty: 'rtndata.totalCount',
								            id:"id",
								            fields: [
								            {name: 'seq'},
								            {name: 'role_id', mapping:'role_id'},
								            {name: 'rolename'},		
											{name: 'permission', type:'boolean'},		
											{name: 'flag', type:'int'},		
											{name: 'id'}
								            ]
								        })
										,remoteSort: false
								    	});
										
									    sm = new Ext.grid.CheckboxSelectionModel();
		                            	win = new Ext.Window({							               
							                id:'ebxboardaclwin',
							                layout:'fit',
							                width:600,
							                resizable : false,
							                height:400,
							                plain: true,
							                closable:false,
							                modal:true,
											monitorValid:true,
											items:[{
											  title: '信息版授权:'+records[0].get("title"),
											  id:"ebxboardacllistpanel",
											  store: store,
											  closable:true,
											  sm: sm,
											  xtype:"grid",
											  columns: [
											  		new Ext.grid.SeqNumberer({seqcolumn:"seq"}),
											  	    sm,
											            {id:'rolename',header: "角色", width: 160, sortable: true, dataIndex: 'rolename'},
											            {header: "浏览权限", width: 75, sortable: false, dataIndex: 'flag', renderer: function(value, metadata, record, rowIndex, colIndex, store){																            
														    if(value)
															{
																if((value & 0x01) == 0x01)
																{
																	if(record.get("permission"))
																	{
																		return "<img src='./images/oa/ok0.gif'>";
																	}
																	else
																	{
																		return "<img src='./images/oa/error0.gif'>";
																	}
																}
															}
														}},
											            {header: "发表权限", width: 75, sortable: false, dataIndex: 'flag', renderer: function(value, metadata, record, rowIndex, colIndex, store){																            
														    if(value)
															{
																if((value & 0x02) == 0x02)
																{
																	if(record.get("permission"))
																	{
																		return "<img src='./images/oa/ok0.gif'>";
																	}
																	else
																	{
																		return "<img src='./images/oa/error0.gif'>";
																	}
																}
															}
														}},
											            {header: "管理权限", width: 75, sortable: false, dataIndex: 'flag', renderer: function(value, metadata, record, rowIndex, colIndex, store){																            
														    if(value)
															{
																if((value & 0x04) == 0x04)
																{
																	if(record.get("permission"))
																	{
																		return "<img src='./images/oa/ok0.gif'>";
																	}
																	else
																	{
																		return "<img src='./images/oa/error0.gif'>";
																	}
																}
															}
														}}
											        ],
											  stripeRows: true,
											  viewConfig: {
										            forceFit:true,
										            enableRowBody:true
										      }
											},
											{
											id:"aclObjectId",
											xtype:"hidden",
											value:records[0].get("oid")
											}],
											buttons: [{
											  	text:'添加',
							                    disabled:false,
												scope:this,
							                    tooltip : '添加权限',
												handler: function(e){
													
													var root2 = new Ext.tree.AsyncTreeNode({
												        id:"0",
														text:"",
												        draggable:false
												    });
			    
													var treepanel2 = new Ext.tree.TreePanel({
																	useArrows:true,
															        animate:true,
																	title:"角色列表",
																	iconCls:"contacts-icon-cls",
															        enableDD:false,
																	rootVisible:false,
																	id:"usertreepanel",
																	containerScroll:true,
																	root:root2,
																	singleExpand:true,
																	loader: new Ext.tree.TreeLoader({
										            						dataUrl:'../ajxrpc/acl.getchildroles'
										            					}),
										        					autoScroll:true
															});
					
													treepanel2.on("expandnode", function(node, e){
														node.loaded=false;			
													});
													
													win1 = new Ext.Window({							               
										                id:'ebxboardusertreewin',
										                layout:'fit',
										                width:400,
										                resizable : false,
														title:'授权',
										                height:300,
										                plain: true,
										                closable:true,
										                modal:true,
														monitorValid:true,
														items:[treepanel2],
														buttonAlign:'center',
														buttons:[
														  {
														  	text: '授权',
														  	disabled: false,
														  	tooltip: '授权',
														  	handler: function(e){
																if(!Ext.getCmp('usertreepanel').getSelectionModel().selNode)
																{
																	Ext.Msg.alert('提示', '请选择你单个操作的记录.');											
																	return false;
																}
																
																//alert(Ext.getCmp('usertreepanel').getSelectionModel().selNode.attributes['id']+":"+Ext.getCmp('usertreepanel').getSelectionModel().selNode.attributes['text']);
																
																win3 = new Ext.Window({							               
													                id:'ebxboardassignuserperwin',
													                layout:'fit',
													                width:350,
													                title: '授权权限',
													                resizable : false,
													                plain: true,
													                closable:true,
													                modal:true,
																	height:200,
																	items:[
																	new Ext.FormPanel({
											      						frame: true,
											      						labelWidth:50,
											      						//monitorValid:true,
											      						id: 'ebxboardaclassignform',
											      						formId:"ebxboardaclassignform2",
											      						reader: new Ext.data.JsonReader({root:'rtndata'},
									                                        [
									                                        {name:'flag',mapping:'flag',type:'int'}, // custom mapping
																			{name:'permission',mapping:'permission',type:'boolean'},
																			{name:'aclid',mapping:'aclid',type:'string'},
																			{name:'roleid',mapping:'roleid',type:'string'}
									                                        ]),
									                                    
																	    bodyStyle:'padding:5px 5px 0',
																	    width: 350,
																	    items:[{
																			xtype: 'panel',
																      		border:false, 
															            	layout: 'column',
															            	fieldLabel: '权限',
																			autoHeight:true,
															            	isFormField: true,  // it is very import, otherwise the label will lose.
															            	items: [{
															            		columnWidth: .33,
															            		items:[{ 
																	                name: 'flag1',																                
																	                boxLabel: '浏览权限',
																	                //itemCls :'x-form-field',
																	                //value: 'issa', //from提交的时候发现Radio group无论选的是哪一项，提交时候的值都是"on"。
																	                inputValue: 1,
																	                xtype:'checkbox'
																	              }
																            	]},{
																            	columnWidth: .33,
																            	items:[{
																	            	name: 'flag2',
																	                boxLabel: '发表权限',
																	                
																	                //itemCls :'x-form-field',
																	                //value: 'isca',  // inputValue属性代替value属性
																	                inputValue: 1,
																	                xtype:'checkbox'
																            	}]
																            	},{
																            	columnWidth: .33,
																            	items:[{
																	            	name: 'flag3',
																	                boxLabel: '管理权限',
																	                
																	                //itemCls :'x-form-field',
																	                //value: 'isca',  // inputValue属性代替value属性
																	                inputValue: 1,
																	                xtype:'checkbox'
																            	}]
															            	}]
																		},
																		{
																			name: 'forbidpermission',
																			boxLabel: '',
																			fieldLabel:'禁止',
																			//itemCls :'x-form-field',
																			//value: 'isca',  // inputValue属性代替value属性
																			inputValue: true,
																			xtype:'checkbox'
																		}]
																	})
																	],
																	buttonAlign:'center',
																	buttons:[
																		{
																			text: '确定',
																			disabled: false,
																			scope: this,
																			tooltip: '确定',
																			handler: function(e){
																				form = Ext.getCmp("ebxboardaclassignform").form;
																				
																				if(form.findField("forbidpermission").checked || form.findField("flag1").checked || form.findField("flag2").checked
																				|| form.findField("flag3").checked )
																				{
																					Ext.Ajax.request({
														                    	 		url:'../ajxrpc/ebxboard.saveforumacl?forumid='+Ext.getCmp('aclObjectId').value+"&roleid="+Ext.getCmp('usertreepanel').getSelectionModel().selNode.attributes['id'],
														                    	 		form: "ebxboardaclassignform2",
																						waitMsg:'保存权限中......',
														                    	 		success: function(response, options){
														                    	 			var rtndata = Ext.util.JSON.decode(response.responseText);
																							
																							if (rtndata && rtndata.success) {														
																								win3.close();
																								gridUtils.refresh("ebxboardacllistpanel");	
																							}
																							else{
																								Ext.MessageBox.show({
																									title: '保存权限失败',
																									msg: rtndata.message,
																									buttons: Ext.MessageBox.OK,
																									animEl: null,
																									icon: Ext.MessageBox.ERROR
																								})
																							}
														                    	 		},
														                    	 		failure: function(){
														                    	 				alert('失败');
														                    	 			}
																					});
																				}
																				
																			}
																		},
																		{
																			text: '关闭',
																		  	disabled: false,
																		  	scope: this,
																		  	tooltip: '关闭',
																		  	handler: function(e){
																				win3.close();
																		  	}
																	  }
																	]
																	});
																
																win3.show(this);
																
																Ext.getCmp("ebxboardaclassignform").load({
																	url: '../ajxrpc/ebxboard.getforumacl?forumid='+Ext.getCmp('aclObjectId').value+"&roleid="+Ext.getCmp('usertreepanel').getSelectionModel().selNode.attributes['id'],
																	method: 'GET',
																	success:function(form, action){
																		flag = formUtils.getLoadDataFieldValue(form, "flag");
																		
																		if(flag)
																		{
																			if((flag & 0x01) == 0x01)
																			{
																				form.findField("flag1").checked = true;	
																				form.findField("flag1").setValue(true); 																		
																			}
																			
																			if((flag & 0x02) == 0x02)
																			{
																				form.findField("flag2").checked = true;
																				form.findField("flag2").setValue(true);																			
																			}
																			
																			if((flag & 0x04) == 0x04)
																			{
																				form.findField("flag3").checked = true;
																				form.findField("flag3").setValue(true);																			
																			}
																		}
																		
																		permission = formUtils.getLoadDataFieldValue(form, "permission");
																		
																		if( (permission == false) || (permission == 'false') )
																		{
																			form.findField("forbidpermission").checked = true;
																			form.findField("forbidpermission").setValue(true);
																		}
																		
																		delete flag;
																		delete permission;
																		
																	},
																	waitMsg: '加载....'
																});
														  	}
														  },
														  {
														  	text: '关闭',
														  	disabled: false,
														  	scope: this,
														  	tooltip: '关闭',
														  	handler: function(e){
																win1.close();
														  	}
														  }]
													});
													
													win1.show(this);
													delete root;
													delete treepanel2;
											  	}
											  },
											  {
											  	text:'删除',
							                    disabled:false,
												scope:this,
							                    tooltip : '删除权限',
												handler: function(e){
													if(!Ext.getCmp("ebxboardacllistpanel"))
														return false;
														
													var records = Ext.getCmp("ebxboardacllistpanel").getSelections();//获取所有被选中的记录集 类型：Ａｒｒａｙ	
													var _length=records.length;
																
													if(_length <= 0)
													{
														Ext.Msg.alert('提示', '请选择你需要操作的记录.');											
														return false;
													}
										
													Ext.MessageBox.confirm('确认',
											           '你确定删除授权记录吗?',
											           function(btn, action)
											           {
											           		if (btn == 'yes'){											           		
																var datas = new Array();
																for(var i=0;i<_length;i++){
																	var record=records[i];
																	var data = record.get('id');
																	datas[i]=data;
																}
																
																var jsondata = new Object();
																jsondata.ids = datas;
																
																Ext.Ajax.request({
											                    	 		url:'../ajxrpc/ebxboard.removeforumacl',
																			params:{jsondata:Ext.util.JSON.encode(jsondata),testid:"11111"},
																			waitMsg:'删除授权记录中......',
											                    	 		success: function(response, options){
											                    	 			var rtndata = Ext.util.JSON.decode(response.responseText);
																				
																				if (rtndata && rtndata.success) {																														
																					gridUtils.refresh("ebxboardacllistpanel");	
																				}
																				else{
																					Ext.MessageBox.show({
																						title: '删除授权记录失败',
																						msg: rtndata.message,
																						buttons: Ext.MessageBox.OK,
																						animEl: null,
																						icon: Ext.MessageBox.ERROR
																					})
																				}
											                    	 		}
																		});
						    									
						    								}
											           }
											       );
											  	}
											  },
											  {
											  	text: '关闭',
											  	disabled: false,
											  	scope: this,
											  	tooltip: '关闭',
											  	handler: function(e){
													win.close();
													Ext.destroy(win);
													delete win;
											  	}
											  }]
										});
										
										win.show(this);
										store.load({params:{forumid:records[0].get("oid")}, callback:function(r, options, success)
									        {
												delete sm;        	
									        }
								        });
										
										delete store;
		                            }
		                        },
								'-', {
		                            text:'修改',
		                            tooltip:'修改',
		                            //iconCls:'option',
		                            handler:function(){
										var records = Ext.getCmp("info1").getSelections();//获取所有被选中的记录集 类型：Ａｒｒａｙ	
										var _length=records.length;
													
										if(_length != 1)
										{
											Ext.Msg.alert('提示', '请选择你单个操作的记录.');											
											return false;
										}
										
										win = new Ext.Window({							               
							                id:'addebxboardwin',
							                layout:'fit',
							                width:400,
							                resizable : false,
							                height:200,
							                plain: true,
							                closable:false,
							                modal:true,
											monitorValid:true,
											
											items: new Ext.FormPanel({
						                			labelWidth: 125,
						      						frame: true,
						      						id: 'ebxboardform',
						      						formId:"ebxboardform2",
													reader: new Ext.data.JsonReader({root:'rtndata'},
									                                        [
									                                        {name:'id',mapping:'id',type:'string'}, // custom mapping
																			{name:'title',mapping:'title',type:'string'},
																			{name:'description',mapping:'description',type:'string'},
																			{name:'createdate',mapping:'createdate',type:'string'}
									                                        ]),
						      						 //autoHeight :true;
												      title: '修改信息版',
												      bodyStyle:'padding:5px 5px 0',
												      width: 350,
												      defaults: {
												        width: 175
												      },
												      defaultType: 'textfield',
												      items: [
												      {
												        fieldLabel: '信息版标题',
												        name: 'exboardname',
												        id: 'exboardname',
												        blankText:'请输入信息版标题!',
												        allowBlank:false,
												        validateOnBlur:true,
														dataIndex:'title',
												        xtype: 'textfield'
												      },{
												        fieldLabel: '信息版描述',
												        name: 'exboardndesc',
												        id:'exboardndesc',
												        allowBlank:false,
												        blankText:'请输入信息版描述!',
												        validateOnBlur:true,
														dataIndex:'description',
												        xtype:'textfield'
												      },{
												        fieldLabel: '创建时间',
												        id:'exboardtime',
														name: 'exboardtime',														
														dataIndex:'createdate',
														readOnly:true,
														xtype:'textfield'
												      }],
													  buttons: [{
													  	text:'确定',
									                    disabled:false,
														scope:this,
									                    tooltip : '确定',
														handler: function(e){
															if(Ext.getCmp("ebxboardform").form.isValid())
															{
																Ext.Ajax.request({
									                    	 		url:'../ajxrpc/ebxboard.saveforum?forumid='+records[0].get('oid'),
									                    	 		form: "ebxboardform2",
																	waitMsg:'保存信息版块中......',
									                    	 		success: function(response, options){
									                    	 			var rtndata = Ext.util.JSON.decode(response.responseText);
																		
																		if (rtndata && rtndata.success) {																														
																			gridUtils.refresh("info1");	
																			treeUtils.reloadnode("forumtreepanel", Ext.getCmp("parentid").value);																		
																																						
																			win.close();
																			Ext.destroy(win);
																		}
																		else{
																			Ext.MessageBox.show({
																				title: '保存信息版块失败',
																				msg: rtndata.message,
																				buttons: Ext.MessageBox.OK,
																				animEl: null,
																				icon: Ext.MessageBox.ERROR
																			})
																		}
									                    	 		},
									                    	 		failure: function(){
									                    	 				alert('failure');
									                    	 			}
																});
															}
													  	}
													  },
													  {
													  	text:'重置',
									                    disabled:false,
														scope:this,
									                    tooltip : '重置',
														handler: function(e){
															//Ext.getCmp("ebxboardform").form.reset();
															formUtils.reset("ebxboardform");
													  	}
													  },
													  {
													  	text: '关闭',
													  	disabled: false,
													  	scope: this,
													  	tooltip: '关闭',
													  	handler: function(e){
															win.close();
															Ext.destroy(win);
													  	}
													  }]
						                	})
											
											
										});
										
										win.show(this);
										
										Ext.getCmp("ebxboardform").load({
											url: '../ajxrpc/ebxboard.getforum?forumid='+records[0].get('oid'),
											method: 'GET',
											waitMsg: '加载....'
										});
		                            }
		                        },
								 '-', {
		                            text:'删除过期文章',
		                            tooltip:'删除过期文章',
		                           
		                            handler:function(){
		                            	var records = Ext.getCmp("info1").getSelections();//获取所有被选中的记录集 类型：Ａｒｒａｙ	
										var _length=records.length;
													
										if(_length <= 0)
										{
											Ext.Msg.alert('提示', '请选择你需要操作的记录.');											
											return false;
										}
											
		                            	Ext.MessageBox.confirm('确认',
								           '你确定要删除选择的记录吗?',
								           function(btn, action)
								           {
								           		if (btn == 'yes'){							           		
		    										
													var datas='';
													for(var i=0;i<_length;i++){
														var record=records[i];
														var data = record.get('title') + " = " + record.get('checker');
														datas=datas+data;
													}
													//alert('message 记录'+datas); 
													Ext.getCmp("info1").view.refresh();
													delete records;
			    								}
								           }
								       );
		                            }
		                        },
								'-',{
		                            text:'删除版',
		                            tooltip:'删除版',
		                            //iconCls:'remove',
		                            handler:function(){
		                            	var records = Ext.getCmp("info1").getSelections();//获取所有被选中的记录集 类型：Ａｒｒａｙ	
										var _length=records.length;
													
										if(_length <= 0)
										{
											Ext.Msg.alert('提示', '请选择你需要操作的记录.');											
											return false;
										}
										
		                            	Ext.MessageBox.confirm('确认',
								           '你确定要删除选择的记录吗?',
								           function(btn, action)
								           {
								           		if (btn == 'yes'){
								           		
									           		var win = Ext.getCmp('info1');
			    									if(win)
			    									{
														var datas = new Array();
														for(var i=0;i<_length;i++){
															var record=records[i];
															var data = record.get('oid');
															datas[i]=data;
														}
														
														var jsondata = new Object();
														jsondata.ids = datas;
														
														Ext.Ajax.request({
									                    	 		url:'../ajxrpc/ebxboard.removeforum',
																	params:{jsondata:Ext.util.JSON.encode(jsondata),testid:"11111"},
																	waitMsg:'删除信息版块中......',
									                    	 		success: function(response, options){
									                    	 			var rtndata = Ext.util.JSON.decode(response.responseText);
																		
																		if (rtndata && rtndata.success) {																														
																			gridUtils.refresh("info1");	
																			treeUtils.reloadnode("forumtreepanel", Ext.getCmp("parentid").value);																							
																		}
																		else{
																			Ext.MessageBox.show({
																				title: '删除信息版块失败',
																				msg: rtndata.message,
																				buttons: Ext.MessageBox.OK,
																				animEl: null,
																				icon: Ext.MessageBox.ERROR
																			})
																		}
									                    	 		},
									                    	 		failure: function(){
									                    	 				alert('failure');
									                    	 			}
																});
			    									}
			    								}
								           }
								       );
		                            }
		                        },
								'-',{
		                            text:'刷新',
		                            tooltip:'刷新',
		                            handler:function(){
		                            	gridUtils.refresh("info1");
		                            }
		                        }
								]
						}
					);
					
					store.load({params:{start:0}, callback:function(r, options, success)
				        {
				        	//sm.selectRows([1,2,3,4]);	
							delete sm;        	
				        }
			        });
					
					obj.activate(temp1);
					delete store;
					delete temp1;
					delete obj;
				}
			)
			
			var root2 = new Ext.tree.AsyncTreeNode({
			        id:"-1",
					text:"",
			        draggable:false
			    });
			    
			var treepanel2 = new Ext.tree.TreePanel({
							useArrows:true,
					        animate:true,
							title:"信息版列表",
							iconCls:"contacts-icon-cls",
					        enableDD:false,
							rootVisible:false,
							id:"forumtreepanel",
							containerScroll:true,
							root:root2,
							singleExpand:true,
							loader: new Ext.tree.TreeLoader({
            						dataUrl:'../ajxrpc/ebxboard.getforumtree'
            					}),
        					autoScroll:true
					});
					
			treepanel2.on("expandnode", function(node, e){
				node.loaded=false;			
			});
					
			treepanel2.on("click", function(node, e){
								
					obj = Ext.getCmp("centerTabPanel");	
					obj1 = Ext.getCmp("ebxboardthreadlist");	
					if (obj1&&obj1.nodeid==node.id) {
						obj.activate(obj1);
						delete obj1;
						delete obj;
						return;
					}
					else if(obj1)
					{
						obj.remove(obj1);						
					}
					
					delete obj1;
				
				    var store = new Ext.data.Store({
			    	/**
			    	proxy: new Ext.data.MemoryProxy(myData),
			    	**/
			    	
			    	/**
			    	proxy: new Ext.data.ScriptTagProxy({
			            url: './pageinfo.jsp'
			        }),
			        **/
			        
			        proxy: new Ext.data.HttpProxy({
			            url: '../ajxrpc/ebxboard.getthreads?forumid='+node.id
			        }),
			        
			        reader: new Ext.data.JsonReader({
			            root: 'rtndata.data',
			            totalProperty: 'rtndata.totalCount',
			            id:"id",
			            fields: [
			            {name: 'seq'},
			            {name: 'id', mapping:'id'},
			            {name: 'forumId'},		
						{name: 'rootMessageId'},		
						{name: 'creationDate'},		
						{name: 'expiredDate'},		
						{name: 'messageSubject'},
						{name: 'author'},
						{name: 'messageCount'}
			            ]
			        })
			        ,remoteSort: true
			        
			    });
				    sm = new Ext.grid.CheckboxSelectionModel();

					temp1 = obj.add(
						{
						  title:"信息版块-"+node.text,
						  id:"ebxboardthreadlist",
						  nodeid:node.id,
						  store: store,
						  closable:true,
						  sm: sm,
						  forumnid:node.id,
						  xtype:"grid",
						  columns: [
						  		new Ext.grid.SeqNumberer({seqcolumn:"seq"}),
						  	    sm,
						            {header: "主题", width: 160, sortable: true, dataIndex: 'messageSubject', renderer: function(value, metadata, record, rowIndex, colIndex, store){
						            
						            	return "<a href='#' onclick='javascript:openBoard("+record.get("rootMessageId")+")'>"+value+"</a>";
						            }},
						            {header: "文章总数", width: 75, sortable: true, dataIndex: 'messageCount'},
						            {header: "作者", width: 75, sortable: true, dataIndex: 'author'},
						            {header: "创建时间", width: 75, sortable: true, dataIndex: 'creationDate'},
						            {header: "过期时间", width: 75, sortable: true, dataIndex: 'expiredDate'}
						        ],
						  stripeRows: true,
						  height:350,
						  width:600,
						  viewConfig: {
					            forceFit:true,
					            enableRowBody:true,
					            showPreview:false
					        },
						  bbar: new Ext.PagingToolbar({
					            pageSize: 15,
					            store: store,
					            displayInfo: true
					        }),
					       tbar:[
						   		{
		                            text:'发表文章',
		                            tooltip:'发表文章',
		                            //iconCls:'add',
									//cls:"x-btn-text-icon",
		                            handler:function(){
										win2 = new Ext.Window({							               
							                id:'addthreadwin',
							                layout:'form',
							                width:600,
							                resizable : false,
							                height:460,
							                plain: true,
							                closable:false,
							                modal:true,
											monitorValid:true,											
											items: [new Ext.FormPanel({
												labelWidth: 40,
					      						frame: true,
												border  :false,
												bodyBorder :false,
					      						id: 'addthreadform',
					      						formId:"addthreadform2",
					      						 //autoHeight :true;
											    title: '发表文章',
											    bodyStyle:'padding:5px 5px 0',
											    defaultType: 'textfield',
												items:[
												{
								                    xtype:'textfield',
								                    id:'threadtitle',
													width: 500,
													name:'threadtitle',
													blankText:'请输入主题',
											        allowBlank:false,
											        validateOnBlur:true,
								                    fieldLabel:'主题'                    
								                },
												{
								                    xtype:'htmleditor',
								                    id:'threadcontent',
													name:'threadcontent',
													blankText:'请输入内容',
											        allowBlank:false,
											        validateOnBlur:true,
								                    fieldLabel:'内容'                    
								                }]
											}),	
											{
												xtype: 'form',									      	
								            	layout: 'column',
												id:"addthreadimageform",
												frame: true,
												border  :false,
												formId:"addthreadimageform2",
								            	items: [
														{
										            		width: 200,
										            		items:[{ 
												                xtype:'textfield',
											                    id:'threadimage',
																name:'threadimage',   
																inputType:'file' 
												              }
											            	]
														},
														{
										            		width: 60,
										            		items:[{ 
												                xtype:'button',
											                    text:'上传',
																handler:function(){
																	if(!Ext.getCmp("threadimage").getValue())
																	{
																		return false;
																	}
																	
																	Ext.Ajax.request({
																		url:"../ajxrpc/attachment.upload",
																		method:"POST",
																		form:"addthreadimageform2",
																		isUpload:true,
																		success:function(B,C){
																			
																			var D=Ext.util.JSON.decode(B.responseText.substring(5, B.responseText.length-6));
																			var imgpath = D.rtndata[0];
																			Ext.getCmp("threadcontent").setValue(Ext.getCmp("threadcontent").getValue()+"<img src='" + imgpath + "'/>")
																			delete D;
																			delete imgpath;
																		},
																		failure:function(B,C){
																			Ext.MessageBox.show({
																				title: '上传失败',
																				msg: rtndata.message,
																				buttons: Ext.MessageBox.OK,
																				animEl: null,
																				icon: Ext.MessageBox.ERROR
																			})
																		},
																		scope:this
																	});
																}
												              }
											            	]
														}
													]
											}],
											buttons:[
												{
													text: '发表',
												  	disabled: false,
												  	scope: this,
												  	tooltip: '发表',
												  	handler: function(e){
														win2.close();														
														Ext.destroy(win2);
														delete win2;
														gridUtils.refresh("ebxboardthreadlist");
												  	}
											  	},
												{
													text: '关闭',
												  	disabled: false,
												  	scope: this,
												  	tooltip: '关闭',
												  	handler: function(e){
														win2.close();														
														Ext.destroy(win2);
														delete win2;
												  	}
											  	}
											]
										});
											
										win2.show(this);
		                            }
		                        },
								'-',{
		                            text:'刷新',
		                            tooltip:'刷新',
		                            handler:function(){
		                            	gridUtils.refresh("ebxboardthreadlist");
		                            }
		                        }
								]
						}
					);
					
					store.load({params:{start:0, limit:15}, callback:function(r, options, success)
				        {
							delete sm;        	
				        }
			        });
					
					obj.activate(temp1);
					delete store;
					delete temp1;
					delete obj;										
			});
					
			var wrappanel = new Ext.Panel({
						collapsible:true,
						autoHeight:true,
						border:true,
						layout:"form",
						frame:true,
						autoScroll:true,
						items:[
								treepanel2
						]
			});
						
			/*	
			root.appendChild(new Ext.tree.TreeNode({
						"text":"build",
				        	"id":"build",
				        	"leaf":true
			}));
			
			root.appendChild(new Ext.tree.TreeNode({
						"text":"INCLUDE_ORDER.txt",
				        	"id":"INCLUDE_ORDER.txt",
				        	"leaf":true
			}));*/
			
			//treepanel.setRootNode(root);
			//treepanel.render();		
			//root.expand();
				
			informationPanel = new Ext.Panel({
				id:"informationPanel",
				title:"信息发布",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					{
						xtype:"panel",
						collapsible:true,
						autoHeight:true,
						border:true,
						layout:"form",
						frame:true,
						items:[
							treepanel
						]
					},wrappanel
				]
			});	 
			
			var calendarroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			
			calendarroot.appendChild(new Ext.tree.TreeNode({
				id:"calendarroot1",
				icon:"../ebschedule/images/my_task.gif",
				text:"今天的日程"
			}));
			
			calendarroot.appendChild(new Ext.tree.TreeNode({
				id:"calendarroot2",
				icon:"../ebschedule/images/new_task.gif",
				text:"新建任务"
			}));
			
			calendarroot.appendChild(new Ext.tree.TreeNode({
				id:"calendarroot3",
				icon:"../ebschedule/images/searcg_cal.gif",
				text:"日程搜索 "
			}));
			
			var calendarrootTreepanel = new Ext.tree.TreePanel({
							title:"个人日历",
							titleCollapse   :false,
					        rootVisible:false,
					        iconCls:"contacts-icon-cls",
							root:calendarroot,
							useArrows:true,
        					autoScroll:true
					});
			
			var calendarroot2 = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			calendarroot2.appendChild(new Ext.tree.TreeNode({
				id:"calendarroot21",
				icon:"../ebschedule/images/other_search.gif",
				text:"日程搜索"
			}));
			
			var calendarrootTreepanel2 = new Ext.tree.TreePanel({
							title:"他人日历",
							titleCollapse   :false,
							iconCls:"contacts-icon-cls",
					        rootVisible:false,
							root:calendarroot2,
							useArrows:true,
        					autoScroll:true
					});
					
			var calendarroot3 = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			calendarroot3.appendChild(new Ext.tree.TreeNode({
				id:"calendarroot31",
				icon:"../ebschedule/images/my_notepad_view.gif",
				text:"记事浏览"
			}));
			
			calendarroot3.appendChild(new Ext.tree.TreeNode({
				id:"calendarroot31",
				icon:"../ebschedule/images/my_notepad_new.gif",
				text:"新建记事"
			}));
			
			var calendarrootTreepanel3 = new Ext.tree.TreePanel({
							title:"记事贴",
							iconCls:"contacts-icon-cls",
							titleCollapse   :false,
					        rootVisible:false,
							root:calendarroot3,
							useArrows:true,
        					autoScroll:true
					});
			
			calendarPanel = new Ext.Panel({
				id:"calendarPanel",
				title:"电子日历",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					{
						xtype:"panel",
						collapsible:true,
						autoHeight:true,
						border:true,
						layout:"form",
						frame:true,
						items:[
							new Ext.DatePicker({
								autoSize:true					
							})
						]
					},
					calendarrootTreepanel,
					calendarrootTreepanel2,
					calendarrootTreepanel3
				]
			});	 
			
			var emstreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			emstreeroot.appendChild(new Ext.tree.TreeNode({
				id:"emstreeroot1",
				icon:"../ebim/images/view_content.gif",
				text:"阅读短信息"
			}));
			
			emstreeroot.appendChild(new Ext.tree.TreeNode({
				id:"emstreeroot2",
				icon:"../ebim/images/sent_new.gif",
				text:"发送短信息 "
			}));
			
			emstreeroot.appendChild(new Ext.tree.TreeNode({
				id:"emstreeroot3",
				icon:"../ebim/images/search_result.gif",
				text:"短信息查询"
			}));
			
			var emsTreepanel = new Ext.tree.TreePanel({
							titleCollapse   :false,
					        rootVisible:false,
					        iconCls:"contacts-icon-cls",
							root:emstreeroot,
							useArrows:true,
        					autoScroll:true
					});
					
			emsPanel = new Ext.Panel({
				id:"emsPanel",
				iconCls:"contacts-icon-cls",
				title:"企业短信",
				
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					emsTreepanel
				]
			});	 
			
			var workflowreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot1",
				icon:"../ebworkflow/images/new_file.gif",
				text:"发行公文"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot2",
				icon:"../ebworkflow/images/view_file.gif",
				text:"公文预览"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot3",
				icon:"../ebworkflow/images/waiting_file.gif",
				text:"待批公文"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot3",
				icon:"../ebworkflow/images/doning_fole.gif",
				text:"批审公文"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot4",
				icon:"../ebworkflow/images/sent_file.gif",
				text:"发出公文"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot4",
				icon:"../ebworkflow/images/passed.gif",
				text:"已批公文"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot5",
				icon:"../ebworkflow/images/refused_file.gif",
				text:"被退公文"
			}));
			
			workflowreeroot.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot6",
				icon:"../ebworkflow/images/doc_search.gif",
				text:"公文搜索"
			}));
			
			var workflowTreepanel = new Ext.tree.TreePanel({
							title:'公文管理',
							titleCollapse   :false,
					        rootVisible:false,
					        iconCls:"contacts-icon-cls",
							root:workflowreeroot,
							useArrows:true,
        					autoScroll:true
					});
			
			var workflowreeroot2 = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			workflowreeroot2.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot21",
				icon:"../ebworkflow/images/public_style.gif",
				text:"公共文档模板"
			}));
			
			workflowreeroot2.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot22",
				icon:"../ebworkflow/images/my_style.gif",
				text:"我的文档模板"
			}));
			
			workflowreeroot2.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot23",
				icon:"../ebworkflow/images/flow_style.gif",
				text:"流程模板"
			}));
			
			workflowreeroot2.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot24",
				icon:"../ebworkflow/images/flowanddoc_style.gif",
				text:"公文模板"
			}));			
			
			var workflowTreepanel2 = new Ext.tree.TreePanel({
							title:'模板管理',
							titleCollapse   :false,
					        rootVisible:false,
					        iconCls:"contacts-icon-cls",
							root:workflowreeroot2,
							useArrows:true,
        					autoScroll:true
					});
			
			var workflowreeroot3 = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			workflowreeroot3.appendChild(new Ext.tree.TreeNode({
				id:"workflowreeroot3",
				icon:"../ebworkflow/images/my_set.gif",
				text:"个人设置"
			}));
					
			
			var workflowTreepanel3 = new Ext.tree.TreePanel({
							title:'个人设置',
							titleCollapse   :false,
					        rootVisible:false,
							root:workflowreeroot3,
							iconCls:"contacts-icon-cls",
							useArrows:true,
        					autoScroll:true
					});
					
			workflowPanel = new Ext.Panel({
				id:"workflowPanel",
				title:"公文审批",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					workflowTreepanel,
					workflowTreepanel2,
					workflowTreepanel3
					
				]
			});	 
			
			var meetingtreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			meetingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"meetingtreeroot1",
				text:"电子会议室"
			}));
			
			meetingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"meetingtreeroot2",
				text:"新建电子会议 "
			}));
					
			meetingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"meetingtreeroot3",
				text:"电子会议管理 "
			}));
			
			var meetingTreepanel = new Ext.tree.TreePanel({
							//title:'个人设置',
							titleCollapse   :false,
					        rootVisible:false,
							root:meetingtreeroot,
							useArrows:true,
        					autoScroll:true
					});
			
			meetingPanel = new Ext.Panel({
				id:"meetingPanel",
				title:"电子会议",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					meetingTreepanel
					
				]
			});	
			
			var mailtreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			mailtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"mailtreeroot1",
				text:"写新邮件"
			}));
			
			mailtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"mailtreeroot2",
				text:"未读邮件 "
			}));
					
			mailtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"mailtreeroot23",
				text:"搜索邮件 "
			}));
			
			var mailTreepanel = new Ext.tree.TreePanel({
							title:'邮件操作',
							titleCollapse   :false,
					        rootVisible:false,
							root:mailtreeroot,
							useArrows:true,
        					autoScroll:true
					});
					
			var mailtreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			mailtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"mailtreeroot1",
				text:"写新邮件"
			}));
			
			mailtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"mailtreeroot2",
				text:"未读邮件 "
			}));
					
			mailtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"mailtreeroot23",
				text:"搜索邮件 "
			}));
			
			var mailTreepanel = new Ext.tree.TreePanel({
							title:'邮件操作',
							titleCollapse   :false,
					        rootVisible:false,
							root:mailtreeroot,
							useArrows:true,
        					autoScroll:true
					});
			
			mailPanel = new Ext.Panel({
				id:"mailPanel",
				title:"电子邮件",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					mailTreepanel
					
				]
			});	
						
			var doctreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			doctreeroot.appendChild(new Ext.tree.TreeNode({
				id:"doctreeroot1",
				text:"新建文件夹"
			}));
			
			doctreeroot.appendChild(new Ext.tree.TreeNode({
				id:"doctreeroot2",
				text:"新建文件"
			}));
					
			doctreeroot.appendChild(new Ext.tree.TreeNode({
				id:"doctreeroot3",
				text:"搜索文件"
			}));
			
			doctreeroot.appendChild(new Ext.tree.TreeNode({
				id:"doctreeroot4",
				text:"上传文件"
			}));
			
			var documentTreePanel = new Ext.tree.TreePanel({
							title:'文件/文件夹操作',
							titleCollapse   :false,
					        rootVisible:false,
							root:doctreeroot,
							useArrows:true,
        					autoScroll:true
					});
			
			documentPanel = new Ext.Panel({
				id:"documentPanel",
				title:"电子文档",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					documentTreePanel
				]
			});	
			
			var settingtreeroot = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			settingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"settingtreeroot1",
				text:"个人信息修改"
			}));
			
			settingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"settingtreeroot2",
				text:"个人密码修改"
			}));
					
			settingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"settingtreeroot3",
				text:"个人签名管理"
			}));
			
			settingtreeroot.appendChild(new Ext.tree.TreeNode({
				id:"settingtreeroot4",
				text:"个人应用管理"
			}));
			
			var settingTreePanel = new Ext.tree.TreePanel({
							title:'个人设置',
							titleCollapse   :false,
					        rootVisible:false,
							root:settingtreeroot,
							useArrows:true,
        					autoScroll:true
					});
					
			var settingtreeroot2 = new Ext.tree.AsyncTreeNode({
			        text: '',
			        draggable:false
			    });	
			
			settingtreeroot2.appendChild(new Ext.tree.TreeNode({
				id:"settingtreeroot21",
				text:"个人桌面设置"
			}));
			
			settingtreeroot2.appendChild(new Ext.tree.TreeNode({
				id:"settingtreeroot22",
				text:"桌面风格设置"
			}));
			
			var settingTreePanel2 = new Ext.tree.TreePanel({
							title:'个性化定制',
							titleCollapse   :false,
					        rootVisible:false,
							root:settingtreeroot2,
							useArrows:true,
        					autoScroll:true
					});
			
			settingPanel = new Ext.Panel({
				id:"settingPane",
				title:"设置及个性化",
				iconCls:"contacts-icon-cls",
				autoShow:true,
				hideMode:"visibility",
				
				bodyStyle:"background-color: white",
				items:[
					settingTreePanel,
					settingTreePanel2
				]
			});			
			
			// LeftPanel 
			accordion = new Ext.Panel({
				region:'west',
                id:'panelAccordion',
                title:'主菜单',
                //split:true,    不可以拖动           
                maxSize: 300,
                frame:false,
                collapsible: true,
                margins:'0 0 0 3',
                layout:'accordion',                
				width:210,
				minSize:150,
				
				defaults:{
					bodyStyle:"background: transparent;",
					border:true,
					frame:true
				},
			
                layoutConfig:{
                	titleCollapse:true,
                	renderHidden:false,
                	hideCollapseTool:false,
                	//activeOnTop:true,
					renderHidden:false,
					border:true,
					collapseFirst:false,
                    animate:true
                },
				
                items: [
                informationPanel,
                calendarPanel,
                emsPanel,
                workflowPanel,
				meetingPanel,
                mailPanel,
                documentPanel,
                settingPanel
                ]
			});
		
			// Main view page
       		win = new Ext.Viewport({
       			title: 'Layout Window',
        		id:'viewportMain',
        		cls:"x-plain",
        		monitorResize:true,	        		
	            layout: 'border',
	            
	            items:[
	            {
					id:"panelNorth",
					region:"north",
					autoShow:true,
					contentEl:"header",
					split:false,
					height:71,
					minSize:71,
					maxSize:71,
					border:false,
					collapsible:false,
					margins:"0 0 0 0",
					bbar:northToolbar
				},
				{
					id:"panelSouth",
					region:"south",
					contentEl:"footer",
					split:false,
					height:24,
					minSize:24,
					maxSize:24,
					border:false,
					collapsible:false,
					margins:"0 0 0 0"
				},/*
	            {
        			region:'south',
                    //contentEl: 'south',
                    split:true,
                    height: 100,
                    minSize: 100,
                    maxSize: 200,
                    collapsible: true,
                    title:'South',
                    margins:'0 0 0 0'
	            },*/
	            centerPanel,	         
		        {
		        	region:'east',
                    title: '用户个人信息',
                    collapsible: true,
                    split:true,
                    width: 225,
                    minSize: 175,
                    maxSize: 400,
                    layout:'fit',
                    margins:'0 5 0 0',
                    items:
                        new Ext.TabPanel({
                            border:false,
                            activeTab:1,
                            tabPosition:'bottom',
                            items:[{
                                html:'<p>A TabPanel component can be a region.</p>',
                                title: 'A Tab',
                                autoScroll:true
                            },
                            new Ext.grid.PropertyGrid({
                                title: 'Property Grid',
                                closable: true,
                                source: {
                                    "(name)": "Properties Grid",
                                    "grouping": false,
                                    "autoFitColumns": true,
                                    "productionQuality": false,
                                    "created": new Date(Date.parse('10/15/2006')),
                                    "tested": false,
                                    "version": .01,
                                    "borderWidth": 1
                                }
                            })
                            ]
                        })
		            },
		            accordion
		    	]
			});	
			
			delete sm;
			delete v1;
			delete settingPanel;
			delete accordion;
			delete calendarPanel;
			delete centerContactsPanel;
			delete centerPanel;
			delete centerTabPanel;
			delete documentPanel;						
			delete emsPanel;	
			delete informationPanel;	
			delete mailPanel;	
			delete meetingPanel;	
			delete northToolbar;	
			delete settingPanel;	
			delete workflowPanel;	
        }
        
});
</script>
<BODY
	style="Z-INDEX: 20000; LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 0px; HEIGHT: 100%">
<DIV class="x-hidden x-date-bottom" id=header>
<TABLE>
	<TBODY>
		<TR>
			<TD><IMG style="TEXT-ALIGN: left" height=32 alt=""
				src="./images/oa/MailLogo64.png">     Xpress网上办公系统</TD>
			<TD></TD>
		</TR>
	</TBODY>
</TABLE>
</DIV>
<DIV class="x-hidden x-date-bottom footer x-toolbar" id=footer
	style="VERTICAL-ALIGN: middle">
	<SPAN class=ytb-text>Xpress网上办公系统 Version 1.0</SPAN>
</DIV>
</BODY>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-3457583-1";
urchinTracker();
</script>
</HTML>
